﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;

namespace Utility
{
    public partial class NotePadPage : PhoneApplicationPage
    {
        App a;
        public NotePadPage()
        {
            InitializeComponent();
            a = App.Current as App;
            bodyTxt.Text = a.LoadTextSetting();
        }

        private void saveSettingBtn_Click(object sender, RoutedEventArgs e)
        {
            a.TextBody = bodyTxt.Text;
            a.SaveTextSetting(bodyTxt.Text);
        }

        private void saveStreamBtn_Click(object sender, RoutedEventArgs e)
        {
            a.SaveTextStream(bodyTxt.Text);
        }

        private void loadSettingBtn_Click(object sender, RoutedEventArgs e)
        {
            bodyTxt.Text = a.LoadTextSetting();
        }

        private void loadStreamBtn_Click(object sender, RoutedEventArgs e)
        {
            bodyTxt.Text = a.LoadTextStream();
        }
    }
}